package com.ghn.cocknovel.ui.activity.setting

import android.os.Bundle
import com.example.basemodel.base.BaseHeadVMActivity
import com.example.basemodel.base.DefaultHeadStyle
import com.ghn.cocknovel.R
import com.ghn.cocknovel.databinding.ActivityFeedbcackBinding
import com.ghn.cocknovel.ui.activity.setting.vm.FeedbackViewModel

/**
 * 意见反馈
 */
class FeedbackActivity : BaseHeadVMActivity<FeedbackViewModel, ActivityFeedbcackBinding, DefaultHeadStyle>() {
    override fun layoutId() = R.layout.activity_feedbcack

    override fun initView(savedInstanceState: Bundle?) {
        mHeadStyle.setLeftImageResource(R.mipmap.ic_back_black)
        mHeadStyle.setTitleBackgroundColor(getColor(R.color.colorBackGround))
        mHeadStyle.setTitleColor("意见反馈", getColor(R.color.black))
        mDatabind.btnSubmit.setOnClickListener {
            mViewModel.savefeedback(mDatabind.etContent.text.toString())
        }
    }

    override fun createObserver() {
        mViewModel.savefeedback.observe(this) {
            showMsg("修改成功!")
            finish()
        }
    }
}